home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global exitFrame, lastchan, genericbug, bugcast, tablecast, rewardlist, closedbox, openbox, blevel, game7level, sblist, newbugs, semisin
- set openbox to the number of cast "open"
- set closedbox to the number of cast "closed"
- set rewardlist to 0
- set the preLoadEventAbort to 1
- set tablecast to []
- repeat with xxx = 1 to 13
- add(tablecast, the number of cast ("table" & xxx))
- end repeat
- set bugcast to []
- repeat with xxx = 1 to 13
- add(bugcast, the number of cast ("p" & xxx & "1"))
- end repeat
- set blevel to game7level + 2
- set genericbug to [-50, -50, 1, 481, 36, 255, 0, 100]
- repeat with xxx = 1 to 48
- set the visible of sprite xxx to 1
- end repeat
- set semisin to [:]
- addProp(semisin, 0, -3)
- addProp(semisin, -3, -3)
- addProp(semisin, -3, 0)
- addProp(semisin, -3, 3)
- addProp(semisin, 0, 3)
- addProp(semisin, 3, 3)
- addProp(semisin, 3, 0)
- addProp(semisin, 3, -3)
- set sblist to [:]
- end
-
- on generatebugs
- global buglist, game7level, bgroup, bnumber
- set buglist to [:]
- if game7level < 1 then
- set game7level to 1
- end if
- if game7level = 1 then
- set bgroup to 3
- set bnumber to 4
- else
- if game7level = 2 then
- set bgroup to 4
- set bnumber to 5
- else
- set bgroup to 3
- set bnumber to 10
- set the visible of sprite 2 to 0
- end if
- end if
- set quicklist to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
- repeat with xxx = 1 to 5
- if xxx <= bgroup then
- set btype to random(count(quicklist))
- set bbug to getAt(quicklist, btype)
- deleteAt(quicklist, btype)
- set dingy to random(bnumber)
- addProp(buglist, bbug, dingy)
- if game7level < 3 then
- puppetSprite(16 + xxx, 1)
- puppetSprite(11 + xxx, 1)
- set the castNum of sprite (16 + xxx) to the number of cast ("digit" & dingy)
- set the castNum of sprite (11 + xxx) to the number of cast ("bug" & bbug)
- set the visible of sprite (16 + xxx) to 1
- set the visible of sprite (11 + xxx) to 1
- end if
- next repeat
- end if
- set the visible of sprite (16 + xxx) to 0
- set the visible of sprite (11 + xxx) to 0
- end repeat
- end
-
- on saylist
- global game7level, add, loclock, animtimer, idealnum, reachcur, grabcur, buglist
- puppetSound(0)
- repeat while the mouseDown
- updateStage()
- end repeat
- talkyou("saylist intro")
- cursor(4)
- set loclock to the frame
- set invertlist to []
- repeat with ddd = 1 to count(buglist)
- add(invertlist, the castNum of sprite (11 + ddd))
- end repeat
- repeat with ddd = 1 to count(buglist)
- set the castNum of sprite (11 + ddd) to the castNum of sprite (11 + ddd) + 1
- updateStage()
- if the mouseDown then
- exit repeat
- end if
- talkyou("s" & getAt(buglist, ddd))
- if the mouseDown then
- exit repeat
- end if
- if getAt(buglist, ddd) > 1 then
- talkyou("*s" & getPropAt(buglist, ddd))
- else
- talkyou("*" & getPropAt(buglist, ddd))
- end if
- if the mouseDown then
- exit repeat
- end if
- end repeat
- repeat with ddd = 1 to count(buglist)
- set the castNum of sprite (11 + ddd) to getAt(invertlist, ddd)
- end repeat
- set reachcur to the number of cast "cursorpos"
- set grabcur to the number of cast "cursorpos2"
- set animtimer to 0
- unLoadCast(the number of cast "s8", the number of cast "click")
- unLoadCast(the number of cast "Catch a Bug", the number of cast "neg04")
- cursor(4)
- preLoadCast("p11", "lastbug")
- repeat with xxx = 1 to count(buglist)
- set pickle to "table" & getPropAt(buglist, xxx)
- preLoadCast("table" & getPropAt(buglist, xxx), "table" & getPropAt(buglist, xxx) + 1)
- end repeat
- cursor([reachcur, reachcur + 1])
- go("gameloop")
- end
-
- on sayandwait soundname
- puppetSound(soundname)
- repeat while not (the soundBusy)
- updateStage()
- end repeat
- repeat while the soundBusy
- updateStage()
- end repeat
- end
-
- on stopMovie
- repeat with xxx = 1 to 48
- set the visible of sprite xxx to 1
- end repeat
- end
-
- on addbug overridetype
- global sblist, genericbug, caughtbugs, idealnum
- if overridetype < 1 then
- set overridetype to 0
- end if
- set thischan to 0
- if count(sblist) < idealnum then
- set thischan to freechan()
- sactivate(thischan, genericbug)
- set bugtype to decidebug(thischan, overridetype)
- set spawn to birth(script "bughive", thischan, bugtype)
- addProp(sblist, thischan, spawn)
- end if
- return thischan
- end
-
- on directtest
- repeat with yyy = -10 to 10
- set rump to EMPTY
- repeat with xxx = -10 to 10
- set rump to rump && directix(0, 0, xxx, yyy)
- end repeat
- put rump
- end repeat
- end
-
- on directix sx, sy, dx, dy
- set dirx to (dx - sx) / 2
- set diry to (dy - sy) / 2
- if dirx < 0 then
- if diry < 0 then
- set direct to 1
- else
- if diry > 0 then
- set direct to 3
- else
- set direct to 2
- end if
- end if
- else
- if dirx > 0 then
- if diry < 0 then
- set direct to 7
- else
- if diry > 0 then
- set direct to 5
- else
- set direct to 6
- end if
- end if
- else
- if diry < 0 then
- set direct to 0
- else
- set direct to 4
- end if
- end if
- end if
- return direct
- end
-
- on showinfo
- global sblist, prisoners, buglist
- repeat with xxx = 1 to count(sblist)
- buginfo(getAt(sblist, xxx))
- end repeat
- end
-
- on decidebug thischan, overridetype
- global game7level, buglist, bugcast, WhichBug, prisoners
- set bugtype to random(13)
- if random(2) = 1 then
- set grababug to 1
- set thingy to buglist - prisoners
- repeat while getAt(thingy, grababug) < 1
- set grababug to grababug + 1
- if grababug > count(prisoners) then
- set grababug to random(count(prisoners))
- exit repeat
- end if
- end repeat
- set bugtype to getPropAt(buglist, grababug)
- end if
- if overridetype > 0 then
- set bugtype to overridetype
- end if
- if bugtype < 7 then
- set shaftx to 710
- set shafty to ((random(2) - 1) * 600) - 60
- if random(2) = 1 then
- set shaftx to random(440) + 200
- else
- set shafty to random(600) - 60
- end if
- else
- if bugtype < 11 then
- set shafty to ((random(2) - 1) * 245) + 231
- set shaftx to 710
- else
- set shaftx to 640
- set shafty to (random(2) - 1) * 480
- if random(2) = 1 then
- set shaftx to random(440) + 200
- else
- set shafty to random(480)
- end if
- end if
- end if
- set the castNum of sprite thischan to getAt(bugcast, bugtype)
- set the locH of sprite thischan to shaftx
- set the locV of sprite thischan to shafty
- return bugtype
- end
-
- on freechan
- global sblist
- set trying to 23
- repeat while objectp(getaProp(sblist, trying))
- set trying to trying + 1
- end repeat
- return trying
- end
-
- on sgn param
- if param > 0 then
- return 1
- else
- if param < 0 then
- return -1
- else
- return 0
- end if
- end if
- end
-
- on killbug param
- global sblist
- if objectp(getaProp(sblist, param)) then
- deleteProp(sblist, param)
- end if
- end
-
- on allofus
- global sblist
- repeat with X = 1 to count(sblist)
- buginfo(getaProp(sblist, getAt(sblist, X)))
- end repeat
- end
-
- on sdeact params
- set params to string(params)
- set num to the number of words in params
- repeat with xxx = 1 to num
- set snum to value(word xxx of params)
- set the locV of sprite snum to the locV of sprite snum
- puppetSprite(snum, 0)
- end repeat
- updateStage()
- end
-
- on sactivate sold, params
- puppetSprite(sold, 1)
- if listp(params) <> EMPTY then
- set the locH of sprite sold to getAt(params, 1)
- set the locV of sprite sold to getAt(params, 2)
- set the type of sprite sold to getAt(params, 3)
- set the castNum of sprite sold to getAt(params, 4)
- set the ink of sprite sold to getAt(params, 5)
- set the foreColor of sprite sold to getAt(params, 6)
- set the backColor of sprite sold to getAt(params, 7)
- set the blend of sprite sold to getAt(params, 8)
- end if
- end
-
- on sinfo sold
- set stemp to []
- add(stemp, the locH of sprite sold)
- add(stemp, the locV of sprite sold)
- add(stemp, the type of sprite sold)
- add(stemp, the castNum of sprite sold)
- add(stemp, the ink of sprite sold)
- add(stemp, the foreColor of sprite sold)
- add(stemp, the backColor of sprite sold)
- add(stemp, the blend of sprite sold)
- return stemp
- end
-
- on shit
- global sblist
- repeat with xxx in sblist
- put xxx
- end repeat
- end
-